<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <title>商城-资料设置</title>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 为开发方便为,所使用的JS和CSS文件本地引用，在生产环境中请考虑使用CDN加速服务 -->
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/valid_style.css">
  <!-- 以下为IE8的兼容性脚本，如果从文件夹中直接打开页面无效，需要部署到服务器端访问才能生效 -->
  <!--[if lt IE 9]>
  <script src="${pageContext.request.contextPath}/js/html5shiv.js"></script>
  <script src="${pageContext.request.contextPath}/js/respond.min.js"></script>
  <![endif]-->
</head>
<body>
  <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
          <span class="sr-only">Toggle navigation</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">
          <!-- 这里插入LOGO图标 -->
          <!-- <img alt="LOGO" src="images/logo.png"/>-->LOL网上商城
        </a>
      </div>
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav navbar-right">
              <li class="dropdown" id="car">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">我的购物车<span style="color: #ffff00">${sessionScope.carSize }<c:if test="${empty sessionScope.carSize }">0</c:if></span>件</a>
                  <ul class="dropdown-menu" role="menu">
                  	<c:forEach items="${sessionScope.car }" var="carBean">
                      <li><a href="${pageContext.request.contextPath}/customer/showProductDetail.action?commodityId=${carBean.value.commodity.id}">${carBean.value.commodity.commodityName }<span class="badge">${carBean.value.count }</span></a></li>
                    </c:forEach>
                      <li class="divider"></li>
                      <li><a href="#">共<span style="color: red">${sessionScope.totalPrice }<c:if test="${empty sessionScope.totalPrice }">0</c:if></span>元</a><a href="${pageContext.request.contextPath}/customer/showCar.action" class="btn btn-default">结算</a></li>
                  </ul>
              </li>
          </ul>
          <form class="navbar-form navbar-right" role="search" action="${pageContext.request.contextPath}/customer/showProduct.action">
              <div class="form-group">
                  <input type="text" class="form-control" name="commName" placeholder="输入商品进行查询">
              </div>
              <button type="submit" class="btn btn-default">搜索</button>
          </form>
          <ul class="nav navbar-nav navbar-right">
              <li>
                  <a href="${pageContext.request.contextPath}/customer/index.action">首页</a>
              </li>
              <li>
                  <a href="${pageContext.request.contextPath}/customer/showProduct.action">商品列表</a>
              </li>
              <c:if test="${sessionScope.user==null }">
	              <li>
	                  <a href="${pageContext.request.contextPath}/customer/user_loginUI.action">登录</a>
	              </li>
	              <li>
	                  <a href="${pageContext.request.contextPath}/customer/user_registerUI.action">注册</a>
	              </li>
              </c:if>
              <c:if test="${sessionScope.user!=null }">
              	  <li>
	                  	<a href="">欢迎，${sessionScope.user.userAccount }</a>
	              </li>
	              <li>
	                  <a href="${pageContext.request.contextPath}/customer/user_logout.action" onclick="return confirm('确定要注销吗？')">注销</a>
	              </li>
	              <li class="dropdown active">
	                  <a href="#" class="dropdown-toggle" data-toggle="dropdown">个人中心</a>
	                  <ul class="dropdown-menu" role="menu">
	                      <li><a href="${pageContext.request.contextPath}/customer/showDataSet.action">资料设置</a></li>
	                      <li><a href="${pageContext.request.contextPath}/customer/showAccount.action">账户</a></li>
	                      <li><a href="${pageContext.request.contextPath}/customer/showOrder.action">我的订单</a></li>
	                  </ul>
	              </li>
              </c:if>
          </ul>
      </div>
    </div>
  </nav>
  <div class="container">
    <div class="row">
      <div class="col-xs-12">
        <img src="${pageContext.request.contextPath}/img/dai.png">
      </div>
    </div>
    <br>
    <div class="row">
      <div class="col-xs-3">
          <div class="invite-block">
              <ul class="nav nav-pills nav-stacked" role="tablist">
                    <li role="presentation"><a href="${pageContext.request.contextPath}/customer/showDataSet.action">资料设置</a></li>
                    <li role="presentation"><a href="${pageContext.request.contextPath}/customer/showAccount.action">账户</a></li>
                    <li role="presentation"><a href="${pageContext.request.contextPath}/customer/showOrder.action">我的订单</a></li>
                    <li role="presentation"><a href="${pageContext.request.contextPath}/customer/showContact.action">常用联系人</a></li>
                    <li role="presentation"><a href="${pageContext.request.contextPath}/customer/showComplain.action">投诉</a></li>
                </ul>
              </div>
      </div>
      <div class="col-xs-9">
          <div class="invite-block">
              <div class="row">
                  <div class="col-xs-12 page-header">
                      <div class="col-xs-12">
                          <h4>
                              资料设置
                          </h4><span>&nbsp;&nbsp;${msg }</span>
                      </div>
                  </div>
              </div>
              <div class="col-xs-12 column">
                  <div class="tabbable" id="data-tabs">
                      <ul class="nav nav-tabs">
                          <li <c:if test="${flag!=1 }">class="active"</c:if>>
                              <a href="#panel1" data-toggle="tab">基础资料</a>
                          </li>
                          <li <c:if test="${flag==1 }">class="active"</c:if>>
                              <a href="#panel2" data-toggle="tab">密码修改</a>
                          </li>
                      </ul>
                      <div class="tab-content">
                          <div class="tab-pane<c:if test="${flag!=1 }"> active</c:if>" id="panel1">
                              <br>
                              <form id="editDataSetForm" class="form-horizontal" role="form" action="${pageContext.request.contextPath}/customer/updateDataSet.action" method="post">
                                  <div class="form-group">
                                      <label class="col-sm-2 control-label">用户名</label>
                                      <div class="col-sm-10" style="padding-top: 7px">
                                          <span>${u.userAccount }</span>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="realName" class="col-sm-2 control-label">真实姓名</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control" id="realName" name="userName" value="${u.userName }" datatype="*" nullmsg="请填写真实姓名" placeholder="真实姓名">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label class="col-sm-2 control-label">性别</label>
                                      <label class="col-sm-1 control-label">男</label>
                                      <div class="col-sm-1" style="padding-top: 7px">
                                          <input type="radio" name="userGender" value="1" <c:if test="${u.userGender==1}">checked="checked"</c:if>>
                                      </div>
                                      <label class="col-sm-1 control-label">女</label>
                                      <div class="col-sm-1" style="padding-top: 7px">
                                          <input type="radio" name="userGender" value="0" <c:if test="${u.userGender==0}">checked="checked"</c:if>>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="email" class="col-sm-2 control-label">邮箱</label>
                                      <div class="col-sm-10">
                                          <input type="email" class="form-control" id="email" name="userEmail" value="${u.userEmail }" datatype="*,e" nullmsg="请填写邮箱" errormsg="邮箱格式不正确" placeholder="邮箱">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="phone" class="col-sm-2 control-label">手机</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control" id="phone" name="userPhone" value="${u.userPhone }" datatype="*,m" nullmsg="请填写手机号" errormsg="手机号码格式不正确" placeholder="手机">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="idcard" class="col-sm-2 control-label">身份证</label>
                                      <div class="col-sm-10">
                                          <input type="text" class="form-control" id="idcard" name="userIdcard" value="${u.userIdcard }" datatype="*" nullmsg="请填写身份证" placeholder="身份证">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <div class="col-sm-offset-2 col-sm-10">
                                          <button type="submit" class="btn btn-default">保存</button>
                                      </div>
                                  </div>
                              </form>
                          </div>
                          <div class="tab-pane<c:if test="${flag==1 }"> active</c:if>" id="panel2">
                              <br>
                              <form id="editPasswordForm" class="form-horizontal" role="form" action="${pageContext.request.contextPath}/customer/updatePassword.action" method="post">
                                  <div class="form-group">
                                      <label for="oldPassword" class="col-sm-2 control-label">旧密码</label>
                                      <div class="col-sm-10">
                                          <input type="password" class="form-control" id="oldPassword" name="userPassword" placeholder="旧密码">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="newPassword" class="col-sm-2 control-label">新密码</label>
                                      <div class="col-sm-10">
                                          <input type="password" class="form-control" id="newPassword" name="newPassword" datatype="*" nullmsg="请填写新密码" placeholder="新密码">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="conf_newPassword" class="col-sm-2 control-label">确认新密码</label>
                                      <div class="col-sm-10">
                                          <input type="password" class="form-control" id="conf_newPassword" datatype="*" nullmsg="请填写确认新密码" recheck="newPassword" errormsg="您两次输入的账号密码不一致！" placeholder="确认新密码">
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <div class="col-sm-offset-2 col-sm-10">
                                          <button type="submit" class="btn btn-default">修改</button>
                                      </div>
                                  </div>
                              </form>
                          </div>
                      </div>
                  </div>
              </div>
              <div>


              </div>
          </div>
    </div>
    </div>
</div>



  <footer class="footer">
    <div class="container">
      <div class="row">
        <div class="col-xs-12"><p class="text-center">COPYRIGHT &copy; 2014 LUOJIE. ALL RIGHTS RESERVED.</p></div>
      </div>
    </div>
  </footer>

  <!-- 外部JS脚本文件 -->
  <script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
  <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
  <script src="${pageContext.request.contextPath}/js/Validform_v5.3.2.js"></script>
  <script>
	$(document).ready(function(){
				form1=$("#editDataSetForm").Validform();
				form2=$("#editPasswordForm").Validform();
				});
	
  </script>
</body>

</html>